package Test;

import java.time.LocalDateTime;
import java.util.Date;

public class Test3 {

    public static void main(String[] args) throws InterruptedException {
        Object obj = new Object();
        //获取当前时间
        long beg = System.currentTimeMillis();
        synchronized (obj){
            System.out.println("wait 之前");
            obj.wait(3000);
            System.out.println("wait 之后");
            long end = System.currentTimeMillis();
            System.out.println("用时：" + (end - beg));
        }
    }
}
